#pragma once
#include "GrammarTree.h"
#include "NFA.h"
#include "DFA.h"

class Regex
{
public:
	class MathResult
	{
	public:
		NWString Result;
		int Length;
		BOOL Matched;

		MathResult() : Length(0),Matched(FALSE){}
	};

	NWString Expression;

	Regex(){}
	Regex(const NWString& Expression);
	MathResult Match(LPTSTR Expression);
	MathResult Match(NWString& Expression);
protected:
	GrammarTree ExpressionGrammarTree;
	CharClassList CharList;
	NFA ExpressionNFA;
	DFA ExpressionDFA;
};